home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / prog / dnalib59.arj / ASMPRINT.BAS < prev    next >
BASIC Source File  |  1994-02-06  |  2KB  |  41 lines

  1. DECLARE SUB GetStrLoc()
  2.  
  3. SUB QPrint(BYVAL Row%,BYVAL Col%,BYVAL St$, BYVAL Attr%)PUBLIC
  4.  
  5. ! push            si              ; Save em
  6. ! push            di              ;
  7. ! push            ds              ;
  8. ! mov             ax,St$          ; get the handle
  9. ! push            ax              ; push it
  10. ! call            getstrloc       ; Get String info
  11. ! mov             ds,dx           ; Set the string seg
  12. ! mov             si,ax           ; set string ptr
  13. ! cmp             cx,0            ; Quit if string = 0
  14. ! je              Done            ;
  15. ! xor             ax,ax           ;
  16. ! mov             ax,Row%         ; get the row
  17. ! dec             al              ; convert row to zero base
  18. ! mov             bl,80           ; get the number of cols
  19. ! mul             bl              ; multiply # of cols * rows
  20. ! add             ax,Col%         ; add the column
  21. ! dec             al              ; convert column to zero base
  22. ! mov             di,ax           ; offset within video page
  23. ! shl             di,1            ; account for color/attribute
  24. ! mov             ax,&HB800       ; default to mono card segment
  25.  
  26. Display:
  27. ! mov             es,ax           ; point ES to video
  28. ! mov             ax,Attr%        ; color/attribute
  29. ! mov          ah,al
  30.  
  31. Printit:
  32. ! lodsb                           ; get a char into al
  33. ! stosw                           ; write char and attr to screen
  34. ! loop            Printit         ; go for entire string
  35.  
  36. Done:                             ' (len\counter already in cx)
  37. ! pop             ds              ; pop em
  38. ! pop             di              ;
  39. ! pop             si              ;
  40.  
  41. END SUB